package com.wuzhun.wxmp.service;

import com.wuzhun.wxmp.model.dto.admin.AdminUserDTO;
import com.wuzhun.wxmp.model.entity.AdminUser;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 管理员表 服务类
 * </p>
 *
 * @author renbaolin
 * @since 2022-12-05
 */
public interface IAdminUserService extends IService<AdminUser> {

    /**
     * 查询用户信息，校验账户和密码
     *
     * @param ip
     * @param username
     * @param password
     * @return
     */
    AdminUserDTO queryUserAndCheckPassword(String ip, String username, String password);

    /**
     * 根据uid查询用户信息
     *
     * @param uid
     * @return
     */
    AdminUserDTO queryUserByUid(Integer uid);

    /**
     * 修改密码
     *
     * @param uid
     * @param oldPassword
     * @param newPassword
     * @param repeatPassword
     * @return
     */
    Boolean editPassword(Integer uid, String oldPassword, String newPassword, String repeatPassword);

    /**
     * 根据用户名查询用户
     *
     * @param username
     * @return
     */
    AdminUserDTO getOneByUsername(String username);
}
